/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.unitedats.Project.Entity;


import java.io.Serializable;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Awad
 */
@Entity
@Table(name = "lookup_currency")
@XmlRootElement
@NamedQueries({
              @NamedQuery(name = "LookupCurrency.findAll", query = "SELECT l FROM LookupCurrency l WHERE l.status = true ORDER BY l.name"),
              @NamedQuery(name = "LookupCurrency.findById", query = "SELECT l FROM LookupCurrency l WHERE l.id = :id"),
              @NamedQuery(name = "LookupCurrency.findByName",
                          query = "SELECT l FROM LookupCurrency l WHERE l.name = :name"),
              @NamedQuery(name = "LookupCurrency.findByStatus",
                          query = "SELECT l FROM LookupCurrency l WHERE l.status = :status")
    })
public class LookupCurrency implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "name")
    private String name;
    @Basic(optional = false)
    @Column(name = "status")
    private Boolean status;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "contractCurrentcyId")
    private List<PmProject> pmProjectList;

    public LookupCurrency() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    @XmlTransient
    public List<PmProject> getPmProjectList() {
        return pmProjectList;
    }

    public void setPmProjectList(List<PmProject> pmProjectList) {
        this.pmProjectList = pmProjectList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LookupCurrency)) {
            return false;
        }
        LookupCurrency other = (LookupCurrency) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.unitedats.Project.Entity.LookupCurrency[ id=" + id + " ]";
    }

}
